<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8"/>
    <title>Vue示例</title>

</head>

<body>
<div id="app">

</div>
<script charset="utf-8" src="../js/vue.min.js" type="text/javascript"></script>
<script type="text/javascript">
    var app = new Vue({
        el: '#app',
        data: {
            show: true,
        },
        methods: {
            init: function (text) {
                console.log(text);
            }
        },
        mounted: function () {
            this.init('在初始化时调用'); // 在初始化时调用
        }
    });

    app.init('通过外部调用'); //在Vue实例外部调用
</script>
</body>

</html>
